<div id="groups">
<? echo $adminMenu->users(); ?>
<h2><? __('GROUPS_ADMIN_TITLE');?> (<? echo $html->link(__('GROUP_NEW',true), array('action'=>'add')); ?>)</h2>
<? echo $form -> create(array('action'=>'delete_groups')); ?>
<table cellpadding="3" cellspacing="1" width="100%">
<tr>
	<td width="7%"></td>
	<td width="300"></td>
	<td width="20%"></td>
	<td width="10%"></td>
</tr>
<tr class="table_head">
	<td colspan="2" class="first-top">
		<? echo $pagination -> create(null,'groups'); ?>
	</td>
	<td colspan="2" class="last-top">
		<? __('SORT_BY'); ?>: <? echo $paginator->sort(__('NAME',true),'name');?>
	</td>
</tr>
<tr>
	<th><? __('ACTION'); ?></th>
	<th><? __('NAME'); ?></th>
	<th><? __('GROUP_USERS'); ?></th>
	<th><? __('DELETE'); ?> <input type="checkbox" onclick="checkAll(this,'GroupDeleteGroupsForm')"/></th>
</tr>
<?
$i = 0;
foreach ($groups as $group):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<? echo $class;?>>
		<td>
			<? echo $html->link($html->image('edit.png',array('alt'=>__('EDIT', true))),array('action'=>'edit', $group['Group']['id']),array('title'=>__('EDIT',true)),null,false); ?> 
			<? echo $html->link($html->image('bin.png',array('alt'=>__('DELETE', true))), array('action'=>'delete', $group['Group']['id']),array('title'=>__('DELETE',true)), __('DELETE_ITEM', true).' #' . $group['Group']['name'],false); ?>
		</td>
		<td>
			<? echo $html->link($group['Group']['name'], array('action'=>'edit', $group['Group']['id'])); ?>
		</td>
		<td>
			<? echo count($group['User']); ?>
		</td>
		<td  align="center">
			<input type="checkbox" name="data[GroupsDelete][]" value="<? echo $group['Group']['id']; ?>"/>
		</td>
	</tr>
<? endforeach; ?>
<tr class="table_head">
	<td colspan="2" class="first-bottom">
		<? echo $pagination -> create(null,'groups'); ?>
	</td>
	<td colspan="2" class="last-bottom">
		<? __('SORT_BY'); ?>: <? echo $paginator->sort(__('NAME',true),'name');?>
	</td>
</tr>
</table>
<div style="float: right; margin: 1em;"><? echo $form -> submit(__('DELETE',true)); ?></div>
</form>
</div>